#pragma once

#include "../Datasources/WavFileSampleReader.h"
#include "../Datasources/FolderReader.h"
#include "../Classifiers/ALD.h"
#include "../Classifiers/ChaineApprentissage.h"
#include "../FeatureProcessing/Preaccentuation.h"
#include "../FeatureProcessing/Normalisation.h"
#include "../FeatureProcessing/MFCC.h"
#include "../FeatureProcessing/SimilarFrameDeletion.h"
#include "../FeatureProcessing/Concatenate.h"
#include "../Entities/Array.h"

using namespace DataSources;
using namespace Classifiers;
using namespace FeatureProcessing;
using namespace Entities;

class ChaineALD : public ChaineApprentissage {
protected :
	WavFileSampleReader::type_pointer wavFile;

public :
	ChaineALD(string baseA, string baseT, 
		int _nbAxes = 45, int _nbCoeffs = 3, int _nbSamplesPerFrame = 80, int _nbFiltres = 10, int _nbFrames = 35){	

		wavFile = new WavFileSampleReader;
		setTrainingBaseReader(new FolderReader(wavFile, baseA));
		setReader(new FolderReader(wavFile, baseT));
		setClassifier(new ALD(_nbAxes));
		addProcessor(new Filtres::Preaccentuation);
		//TraitementSignalPtr norme = new Normalisation;
		addProcessor(new MFCC(_nbCoeffs, _nbSamplesPerFrame, _nbFiltres));
		addProcessor(new Redimensionnement::SimilarFrameDeletion(_nbFrames));
		addProcessor(new Concatenate());
	}

	void train(){
		ChaineApprentissage::train();
	}

	void recognize(){
		ChaineApprentissage::recognize();
	}
};